import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common'
import { AcrossService } from './across.service'
import { CreateAcrossDto } from './dto/create-across.dto'
import { UpdateAcrossDto } from './dto/update-across.dto'

@Controller('across')
export class AcrossController {
  constructor(private readonly acrossService: AcrossService) {}

  @Post()
  async create(@Body() createAcrossDto: CreateAcrossDto) {
    return await this.acrossService.create(createAcrossDto)
  }

  @Get()
  async findAll(@Query() args = {}) {
    return await this.acrossService.findAll(args)
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.acrossService.findOne(+id)
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateAcrossDto: UpdateAcrossDto) {
    return this.acrossService.update(+id, updateAcrossDto)
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.acrossService.remove(+id)
  }

  @Delete('/across/:id')
  async removeAll(@Param('id') id: string) {
    return await this.acrossService.removeAll(+id)
  }
}
